<?php
$nav = $g_db->query("select * from tplist");
$seln = 0;
if(isset($_GET['t']) && intval($_GET['t'])) $seln = intval($_GET['t']);

foreach($nav as $v) 
{
	if($seln == $v['tpid']) 
	{
		$dtitle .= $v['tpname'];
		break;
	}
}
?><!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title><?php echo isset($dtitle)?$dtitle:"" ?>-web家</title>
<meta name="ujianVerification" content="b20feadd01bb3b07d4daf8e0ffdc62b6" />
<meta name="keywords" content="web技术分享,学习 php html css javascript nodejs">
<link href="/css/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="page">
<div class="lg">
	<div>
	<script type="text/javascript">(function(){document.write(unescape('%3Cdiv id="bdcs"%3E%3C/div%3E'));var bdcs = document.createElement('script');bdcs.type = 'text/javascript';bdcs.async = true;bdcs.src = 'http://znsv.baidu.com/customer_search/api/js?sid=15826579674068442640' + '&plate_url=' + encodeURIComponent(window.location.href) + '&t=' + Math.ceil(new Date()/3600000);var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(bdcs, s);})();</script>
	</div>
</div>
<div class="head" id="head">
<?php
foreach($nav as $v)
{
	if($v['tpid'] == 0)
		echo "<a".($seln == 0?" class='sel'":"")." href='/index.php'>",$v['tpname'],"</a>";
	else if($seln == $v['tpid'])
		echo "<a class='sel' href='/list.php?t=",$v['tpid'],"'>",$v['tpname'],"</a>";
	else
		echo "<a href='/list.php?t=",$v['tpid'],"'>",$v['tpname'],"</a>";
}
?>
<a href='/nodejs/'>7天nodejs</a>
<a href='/index.html'>日志</a>
<a href='/g/'>小游戏</a>
<a href='/hong/'>我的</a>
<a href='/view.php?a=69'>电影</a>
</div>
<div class="had" id="ad1">
<!--img title="banner" src="/img/banner.gif" /-->
<script type="text/javascript">
    (function() {
        var s = "_" + Math.random().toString(36).slice(2);
        document.write('<div style="" id="' + s + '"></div>');
        (window.slotbydup = window.slotbydup || []).push({
            id: "u2924126",
            container:  s
        });
    })();
</script>
<!-- 多条广告如下脚本只需引入一次 -->
<script type="text/javascript" src="//cpro.baidustatic.com/cpro/ui/c.js" async="async" defer="defer" ></script>
</div>